package com.example.myapplication.login.model;

/**
 * Created by mantianxing on 2017/12/11.
 */

public class LoginModelImpl implements LoginModel{
    @Override
    public void login(final String userName, final String passWord, final OnLoginListener onLoginListener) {
        new Thread(){
            @Override
            public void run() {
                super.run();
                try{
                    Thread.sleep(3000);
                    if(userName.equals("wyq") && passWord.equals("123456")){
                        onLoginListener.loginSuccess(new User(userName,passWord));
                    } else{
                        onLoginListener.loginFailed("error");
                    }
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }
}
